package com.tool.util;

import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.nio.charset.Charset;
import java.util.Properties;

public class TypesUtil
{
	
	private static Properties props = new Properties();
	
	static
	{
		InputStream is = null;
		try
		{
			is = ConfigUtil.class.getClassLoader().getResourceAsStream(
					"types.properties");
			InputStreamReader isr = new InputStreamReader(is,
					Charset.forName("utf-8"));
			props.load(isr);
			isr.close();
		}
		catch (Exception e)
		{
			e.printStackTrace();
			
			if (is != null)
			{
				try
				{
					is.close();
				}
				catch (Exception e2)
				{
					e2.printStackTrace();
				}
			}
		}
		finally
		{
			if (is != null)
			{
				try
				{
					is.close();
				}
				catch (Exception e)
				{
					e.printStackTrace();
				}
			}
		}
	}
	
	public static String getProperty(String name)
	{
		return props.getProperty(name);
	}
	
	public static void main(String[] args)
	{
		System.out.println(getProperty("VARCHAR"));
	}
}
